package dongshi.daddy.main;

import com.alibaba.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.ProtocolConfig;
import com.alibaba.dubbo.config.RegistryConfig;
import dongshi.daddy.service.externalconfig.MyExternalServiceConfiguration;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.io.IOException;

public class ProviderWithExternlConfigMain {
    public static void main(String[] args) throws IOException {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(MyExternalServiceConfiguration.class);
        ApplicationConfig applicationConfig = context.getBean(ApplicationConfig.class);
        System.out.println("ApplicationConfig is: " + applicationConfig);
        RegistryConfig registryConfig = context.getBean(RegistryConfig.class);
        System.out.println("RegistryConfig is: " + registryConfig);
        ProtocolConfig protocolConfig = context.getBean(ProtocolConfig.class);
        System.out.println("ProtocolConfig is: " + protocolConfig);

        // 主进程不退出
        System.in.read();
    }
}
